/**************************************************************************************
*
*	Copyright (C) 2009 - 2012 Brent Andrew O. Chua - See LICENSE.txt for more info.
*		
*	Filename	-	Component.cpp
*
*	Comments	-	See Component.h
*
**************************************************************************************/

#include "../Include/IComponent.h"
#include "../Include/Actor.h"

namespace Pulse
{
	IComponent::IComponent( Actor *pOwner )
		: m_bEnabled( TRUE ), m_pOwner( pOwner )
	{
		PSX_Assert( pOwner, "Owner of this component must not be null." );
	}

	IComponent::~IComponent( void )
	{
		//PSX_SafeRelease( m_pOwner );
	}

	EErrorCode::Type IComponent::Initialize( XMLElementPtr pElem )
	{
		return EErrorCode::OKAY;
	}

	void IComponent::SetOwner( Actor *pOwner )
	{
		/*if ( m_pOwner )
			m_pOwner->Release();

		m_pOwner = pOwner;

		if ( pOwner )
			pOwner->AddRef();*/
	}

	IComponent * IComponent::GetComponent( EComponent::Type type )
	{
		return m_pOwner->GetComponent( type );
	}


}